package com.autumn.web.configure;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.autumn.web.handlers.ServiceRequestContextHandlerInterceptor;

/**
 * 注册 服务请求 Bean
 * 
 * @author 老码农
 *         <p>
 *         Description
 *         </p>
 * @date 2018-01-08 01:16:46
 */
@Configuration
public class ServiceRequestContextConfiguration {

	/**
	 * 日志
	 */
	private final static Log logger = LogFactory.getLog(ServiceRequestContextConfiguration.class);

	@Bean
	@ConditionalOnMissingBean(ServiceRequestContextHandlerInterceptor.class)
	public ServiceRequestContextHandlerInterceptor dynamicServiceDataSourceFactoryHandler() {
		logger.info("注册上下文服务请求处理器:" + ServiceRequestContextHandlerInterceptor.class);
		return new ServiceRequestContextHandlerInterceptor();
	}

}
